<?php

use yii\db\Migration;

/**
 * Handles the creation of table `project_pre_evaluation_interview`.
 */
class m171027_074910_create_project_pre_evaluation_interview_table extends Migration
{
    /**
     * @inheritdoc
     */
    public function up()
    {
        //(抵押类项目预评估)现场访谈
        $this->createTable('project_pre_evaluation_interview', [
            'id' => $this->bigPrimaryKey(),
            'mortgage_id' => $this->bigInteger()->notNull(),
            'building_title' => $this->string()->comment('楼盘名称'),
            'finished_date' => $this->string()->comment('建成日期'),
            'total_floor' => $this->string()->comment('总层数'),
            'which_floor' => $this->string()->comment('所在层数'),
            'surroundings' => $this->text()->comment('区位描述\周边氛围'),
            'property' => $this->text()->comment('物业通达性'),
            'property_state' => $this->text()->comment('物业维护状况'),
            'whether_work' => $this->smallInteger()->comment('是否营业'),//1营业2居住3空闲4租赁5其它
            'willing' => $this->string()->comment('还款意愿'),
            'is_only' => $this->smallInteger()->comment('是否唯一住房'),//1是2否
            'market_price' => $this->string()->comment('市场走访价格'),
            'market_rent_price' => $this->string()->comment('市场走访租金'),
            'comparison_property' => $this->string()->comment('可比物业'),
            'info_origin' => $this->string()->comment('走访信息来源'),
            'contact' => $this->string()->comment('联系方式'),
            'remark' => $this->text()->comment('备注'),
            'created_at' => $this->timestamp(),
            'lock_user' => $this->integer()->comment('上锁用户'),
            'lock_timestamp' => $this->string()->comment('上锁时间'),
        ]);
    }

    /**
     * @inheritdoc
     */
    public function down()
    {
        $this->dropTable('project_pre_evaluation_interview');
    }
}
